Skip to content

fix: prevent buffer stripe index overflow - #2331

Merged
jaydeluca merged 1 commit into
mainfrom
agent/fix-buffer-stripe-index
Jul 31, 2026
Merged

fix: prevent buffer stripe index overflow#2331
jaydeluca merged 1 commit into
mainfrom
agent/fix-buffer-stripe-index

Conversation

@zeitlinger

Copy link
Copy Markdown
Member

Summary

  • compute Buffer stripe indexes with Math.floorMod(long, int)
  • add regression coverage for thread IDs whose low bits previously narrowed to Integer.MIN_VALUE

This is the focused replacement for the #2282 portion of #2297.

Fixes #2282

Ongoing discussion

None. The earlier review did not identify an unresolved design question for this isolated index fix.

Validation

  • mise run lint:fix
  • mise run build
  • ./mvnw test -pl prometheus-metrics-core -Dcoverage.skip=true -Dcheckstyle.skip=true

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@jaydeluca
jaydeluca merged commit b6cd000 into main Jul 31, 2026
24 checks passed
@jaydeluca
jaydeluca deleted the agent/fix-buffer-stripe-index branch July 31, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping

2 participants